<?php

/**
 * A HELPER CLASS that simulates an Enumeration (which php doesn't have)
 *
 * @author Jason
 */
abstract class TaskType {
  
  const FDK        = 0;
  const PSIRT      = 1;
  const SIRT       = 2;
  const FULLDATA   = 3;
  const ROIDATA    = 4;
  const ROIXYZ     = 5;
  const RECON_NONE = 6;
  
} //////// end helper class /////////////////


/*
 * A HELPER CLASS
 */
class FDK {
  // Default values
  public $filter = 0;  // int [0,3]
  public $alpha  = 1.0; // float [0,1]
} ///////// end helper class ////////

/*
 * A HELPER CLASS. A generic type for PSIRT or SIRT
 */
class Sirt_type {
  // Default values
  public $alpha = 1.0; // float (0,2)
  public $Niter = 1;   // int  [0, inf)
  public $Nsubs = 1;   // int  (0, inf)
  public $subset_modeX = 1; // int: 1 | 21 | 22 | 3 
  public $subset_modeY = 'A'; // char: 'A' | 'B'
  public $outputmodulo = 1048576; // 2^20    int
} /////// end helper class /////////


/**
 * Class for passing around values associated with a job's "task". Constructor
 *  takes a "TaskType" enumeration value.
 *
 * @author Jason
 */
class Params_Task {

  public $taskType;  // uses enumerated type defined above
  public $FDK; 
  /* @var Sirt_type  */
  public $PSIRT;
  public $SIRT; 
  public $ROIXYZ = 0; // int: 0 | 1
  
  // FULLDATA, ROIDATA, RECON_NONE are all empty elements
  //  (No need to specify them in this class; using script will know to include 
  //   the empty elements if taskType == to one of these)
  
  /*
   * @taskType: one of the enumerated values of abstract class TaskType
   */
  public function __construct($taskType) {
    
    $this->taskType = $taskType;
    
    // Get new obj for some task types - to manage subelement vals for those task types
    switch ($this->taskType) {
      
      case TaskType::FDK:
       $this->FDK = new FDK();  // using script can set values since they're public   
        break;
      
      case TaskType::PSIRT:
        $this->PSIRT = new Sirt_type(); // using script can set values since they're public   
        break;
      
      case TaskType::SIRT:
        $this->SIRT  = new Sirt_type(); // using script can set values since they're public  
        break;
      
      case TaskType::FULLDATA:    // empty element - no properties to set
        break;
      case TaskType::ROIDATA:     // empty element - no properties to set
        break;
      case TaskType::ROIXYZ:      // Only one value (no children properties)
        break;
      case TaskType::RECON_NONE:  // empty element - no properties to set
        break;
      default:
        
    } //// end switch(taskType) ///
    
  } ///// end constructor //////
  
  
} ////////////// end class Params_Task ////////////////



?>
